﻿<Window x:Class="BoginyaJournal.FindWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Знайти позицію" Height="485" Width="858" WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="200"  />
        </Grid.RowDefinitions>
            <TextBox Grid.Row="0" Name="txtFilter" VerticalAlignment="Top" TextChanged="TextBox_TextChanged" />
        <DataGrid Grid.Row="1"  Height="Auto" Width="Auto" SelectionMode="Single" CanUserAddRows="False" ItemsSource="{Binding TovarList}" AutoGenerateColumns="False" FontSize="22" SelectedItem="{Binding SelectedTovar}" IsReadOnly="True">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Код" Binding="{Binding Path=Kod}" Width="100"></DataGridTextColumn>
                    <DataGridTextColumn Header="Назва" Binding="{Binding Path=NameTovar}" Width="500" ></DataGridTextColumn>
                    <DataGridTextColumn Header="Ціна" Binding="{Binding Path=CinaProdazh}" Width="200"></DataGridTextColumn>
                </DataGrid.Columns>
            </DataGrid>
        <StackPanel Grid.Row="2" >
            <TextBlock Padding="10" TextWrapping="Wrap" Height="150"  Text="{Binding SelectedTovar}" />
            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
                <Button IsDefault="True" Width="100" Margin="5" Click="Button_Click">OK</Button>
                <Button IsCancel="True" Width="100" Margin="5">Cancel</Button>
            </StackPanel>
        </StackPanel>
    </Grid>
</Window>

    